#ifndef WULC_DILITHIUM_PACKING_H_
#define WULC_DILITHIUM_PACKING_H_

#include "params.h"
#include "poly.h"
#include "polyvec.h"


/*============================================================================*/
/* Macro definitions                                                          */
/*============================================================================*/

#define pack_pk DILITHIUM_NAMESPACE(_pack_pk)

#define pack_sk DILITHIUM_NAMESPACE(_pack_sk)

#define pack_sig DILITHIUM_NAMESPACE(_pack_sig)

#define unpack_pk DILITHIUM_NAMESPACE(_unpack_pk)

#define unpack_sk DILITHIUM_NAMESPACE(_upack_sk)

#define unpack_sig DILITHIUM_NAMESPACE(_unpack_sig)

/*============================================================================*/
/* Function definitions                                                        */
/*============================================================================*/

#ifdef __cplusplus
extern "C"
{ /* start of __cplusplus */
#endif

void pack_pk(uint8_t pk[MAX_CRYPTO_PUBLICKEYBYTES],
             const uint8_t rho[SEEDBYTES], const polyveck *t1);

void pack_sk(uint8_t sk[MAX_CRYPTO_SECRETKEYBYTES],
             const uint8_t rho[SEEDBYTES],
             const uint8_t tr[CRHBYTES],
             const uint8_t key[SEEDBYTES],
             const polyveck *t0,
             const polyvecl *s1,
             const polyveck *s2);

void pack_sig(uint8_t sig[MAX_CRYPTO_BYTES],
              const uint8_t c[SEEDBYTES], const polyvecl *z, const polyveck *h);

void unpack_pk(uint8_t rho[SEEDBYTES], polyveck *t1,
               const uint8_t pk[MAX_CRYPTO_PUBLICKEYBYTES]);

void unpack_sk(uint8_t rho[SEEDBYTES],
               uint8_t tr[CRHBYTES],
               uint8_t key[SEEDBYTES],
               polyveck *t0,
               polyvecl *s1,
               polyveck *s2,
               const uint8_t sk[MAX_CRYPTO_SECRETKEYBYTES]);

int unpack_sig(uint8_t c[SEEDBYTES], polyvecl *z, polyveck *h,
               const uint8_t sig[MAX_CRYPTO_BYTES]);

#ifdef __cplusplus
} /* end of __cplusplus */
#endif




#endif //WULC_DILITHIUM_PACKING_H_
